<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>权限树</title>
		<link rel="stylesheet" type="text/css" href="../../bangnuo/admin/layui/css/layui.css">
		<link rel="stylesheet" type="text/css" href="../../bangnuo/admin/layui_ext/dtree/dtree.css" />
		<link rel="stylesheet" type="text/css" href="../../bangnuo/admin/layui_ext/dtree/font/dtreefont.css" />
		<script type="text/javascript" src="../../bangnuo/admin/layui/layui.js"></script>

	</head>

	<body>
		<div class="container">
			<div class="layui-row layui-col-space10">
				<div class="layui-fluid">
					<fieldset class="layui-elem-field layui-field-title">
						<legend>权限树</legend>
						<div class="layui-field-box">
							<div class="layui-row layui-col-space10" style="margin-top: 10px;">
								<div class="layui-col-xs12">
									<div id="toolbarDiv" style="overflow: auto">
										<!--<table class="layui-hide" id = "menu" lay-filter="menu"></table>-->
										<ul id="demoTree" class="dtree" data-id="0"></ul>
									</div>
								</div>
							</div>
						</div>
					</fieldset>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		layui.extend({
			dtree: '../../bangnuo/admin/layui_ext/dtree/dtree'
		}).use(['element', 'layer', 'table', 'code', 'util', 'dtree', 'form'], function() {
			var element = layui.element,
				layer = layui.layer,
				table = layui.table,
				util = layui.util,
				dtree = layui.dtree,
				form = layui.form,
				$ = layui.$;

			$.ajax({
				type: "post",
				url: "/permissionsEntity/permissionsAll",
                response: { rootName: "context", treeId:"parentId"},
				async: true,
				success: function(data) {
					var DTree = dtree.render({
						elem: "#demoTree",
						data: data.queryResult.list
						//    url: "please input your url"
					});
				}
			});
			
			dtree.on("node(demoTree)", function(obj) {
						layer.msg(JSON.stringify(obj.param));
					})
		});

	</script>

</html>